package com.weishu.finace.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.weishu.common.core.web.domain.AjaxResult;
import com.weishu.core.entity.CwPayOrder;
import com.weishu.core.service.ICwPayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 交易流水controller层
 */
@RestController
@RequestMapping("/payorder")
public class PayOrderController {

    @Autowired
    private ICwPayOrderService iCwPayOrderService;

    /**
     * 交易流水查询
     * @param cwPayOrder
     * @param pageNum
     * @param pageSize
     * @return
     */
    @RequestMapping("getList")
    public AjaxResult getList(CwPayOrder cwPayOrder, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize){
        //分页信息
        PageHelper.startPage(pageNum,pageSize);
        //查询信息
        PageInfo<CwPayOrder> pageInfo = iCwPayOrderService.queryList(cwPayOrder);
        return AjaxResult.success(pageInfo);
    }
}
